<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../vue.js"></script>
</head>
<body>

<div id="root">
    <div>
        <input type="text" v-model="inputValue">
        <button @click="clicked">提交</button>
    </div>
    <ul>
        <li v-for="item of list">{{item}}</li>
    </ul>
</div>


</body>
<script>
    new Vue({
        el: "#root",
        data: {
            inputValue:"",
            list:[],
        },
        methods:{
            clicked:function () {
                this.list.push(this.inputValue);
                this.inputValue="";
            }
        }
    })

</script>
</html>